Skip to content

Conversation

nate-chandler
Copy link
Contributor

When storing an instance of some type that conforms to Hashable into an lvalue of type AnyHashable, the source rvalue needs to be emitted within a new SGFContext. Otherwise, the LocalVarInitialization for the var of type AnyHashable would be used and an attempt would be made to store the instance of the conforming type into the projected box.

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler changed the title [OpaqueValues] Emit r-value of AnyHashable erasure into new context. [OpaqueValues] Emit RValue of AnyHashable erasure into new context. Aug 4, 2023
Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@nate-chandler nate-chandler force-pushed the opaque-values/20230804/1/any-hashable-var branch from 30b6f79 to c451fc2 Compare August 9, 2023 14:02
When storing an instance of some type that conforms to Hashable into an
lvalue of type AnyHashable, the source rvalue needs to be emitted within
a new SGFContext.  Otherwise, the LocalVarInitialization for the var of
type AnyHashable would be used and an attempt would be made to store the
instance of the conforming type into the projected box.
@nate-chandler nate-chandler force-pushed the opaque-values/20230804/1/any-hashable-var branch from c451fc2 to 999f2b0 Compare August 9, 2023 14:03
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler merged commit c3fb137 into swiftlang:main Aug 10, 2023
@nate-chandler nate-chandler deleted the opaque-values/20230804/1/any-hashable-var branch August 10, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants